package com.deli.service.impl;

import com.deli.mapper.TestAnalysis93Mapper;
import com.deli.service.TestAnalysis93Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * @author youzi
 * @date 2018-06-19 10:46
 */
@Service("testAnalysis93Service")
@Transactional
public class TestAnalysis93ServiceImpl implements TestAnalysis93Service {

    @Autowired
    private TestAnalysis93Mapper testAnalysis93Mapper;

    @Override
    public LinkedHashMap<String, Object> getAnalysisByName(String roleName) throws Exception {
        List<LinkedHashMap<String, Object>> dataList = testAnalysis93Mapper.getAnalysisByName(roleName);
        if (dataList == null || dataList.size() < 1) {
            throw new Exception("93题具体分析:查询不到具体的解释记录");
        }
        return dataList.get(0);
    }
}
